/**
 * 
 */
package edu.scheduler.valueobject;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Admin
 * 
 */
public class BusinessDate extends Date {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3004318694344197052L;

	private Date date;

	public BusinessDate(String strDate) {
		try {
			this.date = getDateFormat().parse(strDate);
		} catch (ParseException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public String toString() {
		return getDateFormat().format(date);
	}

	/**
	 * @return
	 */
	private SimpleDateFormat getDateFormat() {
		SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMM-YYYY");
		return dateFormat;
	}

}
